<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>AWTK-JAVA: awtk.DigitClock类 参考</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">AWTK-JAVA
   </div>
   <div id="projectbrief">AWTK JAVA API</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- 制作者 Doxygen 1.8.13 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'搜索');
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
  initMenu('',true,false,'search.php','搜索');
  $(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><b>awtk</b></li><li class="navelem"><a class="el" href="classawtk_1_1_digit_clock.html">DigitClock</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#pub-methods">Public 成员函数</a> &#124;
<a href="#pub-static-methods">静态 Public 成员函数</a> &#124;
<a href="#pub-attribs">Public 属性</a> &#124;
<a href="classawtk_1_1_digit_clock-members.html">所有成员列表</a>  </div>
  <div class="headertitle">
<div class="title">awtk.DigitClock类 参考</div>  </div>
</div><!--header-->
<div class="contents">
<div class="dynheader">
类 awtk.DigitClock 继承关系图:</div>
<div class="dyncontent">
 <div class="center">
  <img src="classawtk_1_1_digit_clock.png" usemap="#awtk.DigitClock_map" alt=""/>
  <map id="awtk.DigitClock_map" name="awtk.DigitClock_map">
</map>
 </div></div>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public 成员函数</h2></td></tr>
<tr class="memitem:abc514be4f08d6a4a50021aec2092de98"><td class="memItemLeft" align="right" valign="top"><a id="abc514be4f08d6a4a50021aec2092de98"></a>
&#160;</td><td class="memItemRight" valign="bottom"><b>DigitClock</b> (long nativeObj)</td></tr>
<tr class="separator:abc514be4f08d6a4a50021aec2092de98"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a35da0efc53cfd5ed07f700582c9e62b6"><td class="memItemLeft" align="right" valign="top"><a class="el" href="enumawtk_1_1_ret.html">Ret</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classawtk_1_1_digit_clock.html#a35da0efc53cfd5ed07f700582c9e62b6">setFormat</a> (String format)</td></tr>
<tr class="separator:a35da0efc53cfd5ed07f700582c9e62b6"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa7f313f77b142928ca4cfba1b9cc973a"><td class="memItemLeft" align="right" valign="top">String&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classawtk_1_1_digit_clock.html#aa7f313f77b142928ca4cfba1b9cc973a">getFormat</a> ()</td></tr>
<tr class="separator:aa7f313f77b142928ca4cfba1b9cc973a"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-static-methods"></a>
静态 Public 成员函数</h2></td></tr>
<tr class="memitem:ab38056d5b864750c5a0d78e17167291a"><td class="memItemLeft" align="right" valign="top"><a id="ab38056d5b864750c5a0d78e17167291a"></a>
static <a class="el" href="classawtk_1_1_digit_clock.html">DigitClock</a>&#160;</td><td class="memItemRight" valign="bottom"><b>cast</b> (long nativeObj)</td></tr>
<tr class="separator:ab38056d5b864750c5a0d78e17167291a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab4ee4495873001c7c6f66210e33bf795"><td class="memItemLeft" align="right" valign="top">static Widget&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classawtk_1_1_digit_clock.html#ab4ee4495873001c7c6f66210e33bf795">create</a> (Widget parent, int x, int y, int w, int h)</td></tr>
<tr class="separator:ab4ee4495873001c7c6f66210e33bf795"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a562c95916c563320b78f65d1a67c9710"><td class="memItemLeft" align="right" valign="top">static <a class="el" href="classawtk_1_1_digit_clock.html">DigitClock</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classawtk_1_1_digit_clock.html#a562c95916c563320b78f65d1a67c9710">cast</a> (Widget widget)</td></tr>
<tr class="separator:a562c95916c563320b78f65d1a67c9710"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-attribs"></a>
Public 属性</h2></td></tr>
<tr class="memitem:ac58d00ebc14b09d2d9fd40fdec9e5aa9"><td class="memItemLeft" align="right" valign="top"><a id="ac58d00ebc14b09d2d9fd40fdec9e5aa9"></a>
long&#160;</td><td class="memItemRight" valign="bottom"><b>nativeObj</b></td></tr>
<tr class="separator:ac58d00ebc14b09d2d9fd40fdec9e5aa9"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">详细描述</h2>
<div class="textblock"><p>数字时钟控件。</p>
<p>digit_clock_t是widget的子类控件，widget_t的函数均适用于digit_clock_t控件。</p>
<p>在xml中使用"digit\_clock"标签创建数字时钟控件。如：</p>
<div class="fragment"><div class="line">&lt;<span class="keywordtype">digit_clock</span> <span class="keyword">format</span>=<span class="stringliteral">&quot;YY/MM/DD h:mm:ss&quot;</span>/&gt;</div></div><!-- fragment --><p>更多用法请参考：<a href="https://github.com/zlgopen/awtk/blob/master/demos/assets/default/raw/ui/digit_clock.xml">digit_clock.xml</a></p>
<p>在c代码中使用函数digit_clock_create创建数字时钟控件。如：</p>
<p>完整示例请参考：<a href="https://github.com/zlgopen/awtk-c-demos/blob/master/demos/digit_clock.c">digit_clock demo</a></p>
<p>可用通过style来设置控件的显示风格，如字体的大小和颜色等等。如：</p>
<div class="fragment"><div class="line">&lt;<span class="keywordtype">style</span> <span class="keyword">name</span>=<span class="stringliteral">&quot;default&quot;</span>&gt;</div><div class="line">&lt;<span class="keywordtype">normal</span> <span class="keyword">text_color</span>=<span class="stringliteral">&quot;black&quot;</span> /&gt;</div><div class="line">&lt;/<span class="keywordtype">style</span>&gt;</div></div><!-- fragment --><p>更多用法请参考：<a href="https://github.com/zlgopen/awtk/blob/master/demos/assets/default/raw/styles/default.xml#L138">theme default</a> </p>
</div><h2 class="groupheader">成员函数说明</h2>
<a id="a562c95916c563320b78f65d1a67c9710"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a562c95916c563320b78f65d1a67c9710">&#9670;&nbsp;</a></span>cast()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static <a class="el" href="classawtk_1_1_digit_clock.html">DigitClock</a> awtk.DigitClock.cast </td>
          <td>(</td>
          <td class="paramtype">Widget&#160;</td>
          <td class="paramname"><em>widget</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>转换为digit_clock对象(供脚本语言使用)。</p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">widget</td><td>digit_clock对象。</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>返回</dt><dd>digit_clock对象。 </dd></dl>

</div>
</div>
<a id="ab4ee4495873001c7c6f66210e33bf795"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ab4ee4495873001c7c6f66210e33bf795">&#9670;&nbsp;</a></span>create()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static Widget awtk.DigitClock.create </td>
          <td>(</td>
          <td class="paramtype">Widget&#160;</td>
          <td class="paramname"><em>parent</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>x</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>y</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>w</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>h</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>创建digit_clock对象</p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">parent</td><td>父控件 </td></tr>
    <tr><td class="paramname">x</td><td>x坐标 </td></tr>
    <tr><td class="paramname">y</td><td>y坐标 </td></tr>
    <tr><td class="paramname">w</td><td>宽度 </td></tr>
    <tr><td class="paramname">h</td><td>高度</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>返回</dt><dd>对象。 </dd></dl>

</div>
</div>
<a id="aa7f313f77b142928ca4cfba1b9cc973a"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aa7f313f77b142928ca4cfba1b9cc973a">&#9670;&nbsp;</a></span>getFormat()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">String awtk.DigitClock.getFormat </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>显示格式。</p>
<ul>
<li>Y 代表年(完整显示)</li>
<li>M 代表月(1-12)</li>
<li>D 代表日(1-31)</li>
<li>h 代表时(0-23)</li>
<li>m 代表分(0-59)</li>
<li>s 代表秒(0-59)</li>
<li>w 代表星期(0-6)</li>
<li>W 代表星期的英文缩写(支持翻译)</li>
<li>YY 代表年(只显示末两位)</li>
<li>MM 代表月(01-12)</li>
<li>DD 代表日(01-31)</li>
<li>hh 代表时(00-23)</li>
<li>mm 代表分(00-59)</li>
<li>ss 代表秒(00-59)</li>
<li>MMM 代表月的英文缩写(支持翻译)</li>
</ul>
<p>如 日期时间为：2018/11/12 9:10:20</p><ul>
<li>"Y/D/M"显示为"2018/11/12"</li>
<li>"Y-D-M"显示为"2018-11-12"</li>
<li>"Y-D-M h:m:s"显示为"2018-11-12 9:10:20"</li>
<li>"Y-D-M hh:mm:ss"显示为"2018-11-12 09:10:20" </li>
</ul>

</div>
</div>
<a id="a35da0efc53cfd5ed07f700582c9e62b6"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a35da0efc53cfd5ed07f700582c9e62b6">&#9670;&nbsp;</a></span>setFormat()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="enumawtk_1_1_ret.html">Ret</a> awtk.DigitClock.setFormat </td>
          <td>(</td>
          <td class="paramtype">String&#160;</td>
          <td class="paramname"><em>format</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>设置显示格式。</p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">format</td><td>格式。</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>返回</dt><dd>返回RET_OK表示成功，否则表示失败。 </dd></dl>

</div>
</div>
<hr/>该类的文档由以下文件生成:<ul>
<li>output/DigitClock.java</li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
制作者 &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.13
</small></address>
</body>
</html>
